Review Board 1.7.16


Add ISDN Calling and Called Subaddress support functions to LIBPRI

Review Request #406 - Created Oct. 14, 2009 and submitted

Alec Davis
15604
Reviewers
asterisk-dev
mattf, rmudgett
LibPRI
Further Libpri support for subaddress, previously LIBPRI only supported receiving Calling Subaddress.

The first intentions of this are to add Transmit and Receive capabilites for Calling Subaddress and Called Subaddress.

Calling, Called, Connected and Redirecting Subaddress, now correctly supports User Specific type and the default NSAP.

Redirection and Redirecting Subaddress have been identified, but will come later.

 

Diff revision 3

This is not the most recent revision of the diff. The latest diff is revision 7. See what's changed.

1 2 3 4 5 6 7
1 2 3 4 5 6 7

  1. /team/rmudgett/subaddr/libpri.h: Loading...
  2. /team/rmudgett/subaddr/pri.c: Loading...
  3. /team/rmudgett/subaddr/pri_internal.h: Loading...
  4. /team/rmudgett/subaddr/pri_q931.h: Loading...
  5. /team/rmudgett/subaddr/q931.c: Loading...
/team/rmudgett/subaddr/libpri.h
Revision 1218 New Change
[20] 595 lines
[+20] [+] typedef struct pri_event_ring {
596
	int cref;					/* Call Reference Number */
596
	int cref;					/* Call Reference Number */
597
	int ctype;					/* Call type (see PRI_TRANS_CAP_* */
597
	int ctype;					/* Call type (see PRI_TRANS_CAP_* */
598
	int layer1;					/* User layer 1 */
598
	int layer1;					/* User layer 1 */
599
	int complete;				/* Have we seen "Complete" i.e. no more number? */
599
	int complete;				/* Have we seen "Complete" i.e. no more number? */
600
	q931_call *call;			/* Opaque call pointer */
600
	q931_call *call;			/* Opaque call pointer */
601
	char callingsubaddr[256];	/* Calling parties subaddress */
601
	char callingsubaddr[256];	/* Calling parties subaddress, backwards compatibility */
602
	int progress;
602
	int progress;
603
	int progressmask;
603
	int progressmask;
604
	char origcalledname[256];
604
	char origcalledname[256];
605
	char origcallednum[256];
605
	char origcallednum[256];
606
	int callingplanorigcalled;		/* Dialing plan of Originally Called Number */
606
	int callingplanorigcalled;		/* Dialing plan of Originally Called Number */
607
	int origredirectingreason;
607
	int origredirectingreason;
608
	int reversecharge;
608
	int reversecharge;
609
	struct pri_subcommands *subcmds;
609
	struct pri_subcommands *subcmds;

    
   
610
	struct pri_party_id calling;			/* Calling Party's info, initially subaddress' */

    
   
611
	struct pri_party_subaddress called_subaddress;	/* Called parties subaddress */
610
} pri_event_ring;
612
} pri_event_ring;
611

    
   
613

   
612
typedef struct pri_event_hangup {
614
typedef struct pri_event_hangup {
613
	int e;
615
	int e;
614
	int channel;				/* Channel requested */
616
	int channel;				/* Channel requested */
[+20] [20] 216 lines
[+20] [+] struct timeval *pri_schedule_next(struct pri *pri);
831
extern pri_event *pri_schedule_run(struct pri *pri);
833
extern pri_event *pri_schedule_run(struct pri *pri);
832
extern pri_event *pri_schedule_run_tv(struct pri *pri, const struct timeval *now);
834
extern pri_event *pri_schedule_run_tv(struct pri *pri, const struct timeval *now);
833

    
   
835

   
834
int pri_call(struct pri *pri, q931_call *c, int transmode, int channel,
836
int pri_call(struct pri *pri, q931_call *c, int transmode, int channel,
835
   int exclusive, int nonisdn, char *caller, int callerplan, char *callername, int callerpres,
837
    int exclusive, int nonisdn, char *caller, int callerplan, char *callername, int callerpres,
836
	 char *called,int calledplan, int ulayer1);
838
    char *called, int calledplan, int ulayer1);
837

    
   
839

   
838
struct pri_sr *pri_sr_new(void);
840
struct pri_sr *pri_sr_new(void);
839
void pri_sr_free(struct pri_sr *sr);
841
void pri_sr_free(struct pri_sr *sr);
840

    
   
842

   
841
int pri_sr_set_channel(struct pri_sr *sr, int channel, int exclusive, int nonisdn);
843
int pri_sr_set_channel(struct pri_sr *sr, int channel, int exclusive, int nonisdn);
[+20] [20] 11 lines
[+20] [+] int pri_sr_set_called(struct pri_sr *sr, char *called, int calledplan, int complete);
853
void pri_sr_set_caller_party(struct pri_sr *sr, const struct pri_party_id *caller);
855
void pri_sr_set_caller_party(struct pri_sr *sr, const struct pri_party_id *caller);
854
/*! \note Use pri_sr_set_caller_party() instead to pass more precise caller information. */
856
/*! \note Use pri_sr_set_caller_party() instead to pass more precise caller information. */
855
int pri_sr_set_caller(struct pri_sr *sr, char *caller, char *callername, int callerplan, int callerpres);
857
int pri_sr_set_caller(struct pri_sr *sr, char *caller, char *callername, int callerplan, int callerpres);
856

    
   
858

   
857
/*!
859
/*!

    
   
860
 * \brief Set the calling/called subaddress information in the call SETUP record.

    
   
861
 *

    
   
862
 * \param sr New call SETUP record.

    
   
863
 * \param Subaddress information to set.

    
   
864
 *

    
   
865
 * \return Nothing

    
   
866
 */

    
   
867

   

    
   
868
#define HAVE_PRI_SUBADDR

    
   
869
/* XXX TODO XXX remove the above HAVE_PRI_SUBADDR line and put a test for the feature in configure.ac when it is committed

    
   
870
 */

    
   
871
void pri_sr_set_called_subaddress(struct pri_sr *sr, const struct pri_party_subaddress *subaddress);

    
   
872

   

    
   
873
/*!
858
 * \brief Set the redirecting information in the call SETUP record.
874
 * \brief Set the redirecting information in the call SETUP record.
859
 *
875
 *
860
 * \param sr New call SETUP record.
876
 * \param sr New call SETUP record.
861
 * \param caller Redirecting information to set.
877
 * \param caller Redirecting information to set.
862
 *
878
 *
[+20] [20] 8 lines
[+20] [+] int pri_sr_set_redirecting(struct pri_sr *sr, char *num, int plan, int pres, int reason);
871
void pri_sr_set_useruser(struct pri_sr *sr, const char *userchars);
887
void pri_sr_set_useruser(struct pri_sr *sr, const char *userchars);
872
void pri_sr_set_reversecharge(struct pri_sr *sr, int requested);
888
void pri_sr_set_reversecharge(struct pri_sr *sr, int requested);
873

    
   
889

   
874
void pri_call_set_useruser(q931_call *sr, const char *userchars);
890
void pri_call_set_useruser(q931_call *sr, const char *userchars);
875

    
   
891

   

    
   
892

   
876
int pri_setup(struct pri *pri, q931_call *call, struct pri_sr *req);
893
int pri_setup(struct pri *pri, q931_call *call, struct pri_sr *req);
877

    
   
894

   
878
/*!
895
/*!
879
 * \brief Set a call as a call indpendent signalling connection (i.e. no bchan)
896
 * \brief Set a call as a call indpendent signalling connection (i.e. no bchan)
880
 * \note Call will automaticlly disconnect after signalling sent.
897
 * \note Call will automaticlly disconnect after signalling sent.
[+20] [20] 124 lines
/team/rmudgett/subaddr/pri.c
Revision 1218 New Change
 
/team/rmudgett/subaddr/pri_internal.h
Revision 1218 New Change
 
/team/rmudgett/subaddr/pri_q931.h
Revision 1218 New Change
 
/team/rmudgett/subaddr/q931.c
Revision 1218 New Change
 
  1. /team/rmudgett/subaddr/libpri.h: Loading...
  2. /team/rmudgett/subaddr/pri.c: Loading...
  3. /team/rmudgett/subaddr/pri_internal.h: Loading...
  4. /team/rmudgett/subaddr/pri_q931.h: Loading...
  5. /team/rmudgett/subaddr/q931.c: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.