Send hold toward to sip provider

I use Asterisk for test automation to generate calls. Asterisk handle outgoing and incoming calls also.
I use ARI to interact/command Asterisk and execute custom test scenarios.

When I fire hold on a certain channel, Asterisk start to play MoH on that channel, instead of sending hold message to sip provider. Chain SIP being used as channel driver.

Is there any way to send reinvite with “sendonly”?

An example of my sip.conf:


    [general]
    qualify=yes
    tcpenable=yes
    canreinvite=no
    allowguest=no
    srvlookup=yes
    timert1=500
    t1min=500
    
    
    register => <username>@<domainname>:<pwd>@<domainname>/<callerid>
    
    
    [<callerid>]
    type=peer
    context=incoming
    callerid=<callerid>
    trustpid=no
    sendrpid=no
    canreinvite=no
    fromdomain=<domainname>
    fromuser=<username>
    username=<username>
    defaultusername=<username>
    insecure=invite,port
    disallow=all
    allow=ulaw, alaw, gsm
    host=<domainname>
    secret=<pwd>
    nat=no

The chan_sip module does not support this. The chan_pjsip module has an option, moh_passthrough, as of Asterisk 15 which will send the hold/unhold using SIP signaling instead of having Asterisk produce media itself.

2 Likes

Thanks for reply.

I have tried to convert my sip config file to pjsip config with the script on the below link.

The configuration looks almost good. I can register, but when I try originate a call, authentication is failing when Asterisk is being challenged.

The converted config file contains some report about what was not mapped in the new config file.
See in example

I quess my issue due to missing username in the configuration.

;--
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Non mapped elements start
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[general]
qualify = yes


[35322223401]
username = <uname>


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Non mapped elements end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
--;

The full config file: pjsip.conf.txt (2.2 KB)

Could you take a look, how should I map the username?

Your configuration is too sanitized to understand what is going on, some of it doesn’t make sense unless you had a really messy weird incorrect in ways sip.conf…

I’d suggest you provide an actual call attempt console log and SIP trace.

There are also examples[1] on the wiki for configuring which you can use to compare.

[1] https://wiki.asterisk.org/wiki/display/AST/res_pjsip+Configuration+Examples

Thank you. The current version that I use is 14, but I will double check when upgrade is done/